function editMode(){
  mapObj.setMapMode(MMapMode.EDIT);
}

function browseMode(){
  mapObj.setMapMode(MMapMode.BROWSE);
}

function createPoint(){
  var defaultPointStyle = new MStyle();
  defaultPointStyle.canBeTop = true;
  mapObj.addGeometry(MGeometry.TYPE_POINT, defaultPointStyle);
  exportMapData();
}

function createPolyline(){
  var polylineStyle = new MStyle();
  polylineStyle.lineColor = 0x00ff00;
  polylineStyle.lineSize = 5;
  polylineStyle.lineOpacity = 60;
  polylineStyle.showTip = true;
  mapObj.addGeometry(MGeometry.TYPE_POLYLINE, polylineStyle);
  exportMapData();
}

function createPolygon(){
  var polygonStyle = new MStyle();
  polygonStyle.lineColor = 0x00ff99;
  polygonStyle.lineSize = 5;
  polygonStyle.lineOpacity = 60;
  polygonStyle.fillOpacity = 50;
  polygonStyle.fillColor = 0x999900;
  mapObj.addGeometry(MGeometry.TYPE_POLYGON, polygonStyle);
  exportMapData();
}

function exportMapData(){
  mapObj.exportMapData();
}

function onexportMapData(event){
//  alert(event.args);
  document.data.mapdata.value = event.args ;
}
